package com.example.tests;

import static org.hamcrest.Matchers.*;
import static org.junit.Assert.assertThat;
import java.util.Random;
import org.testng.annotations.Test;
import com.example.utils.SortedListOf;

public class GroupRemovelTests extends TestBase {

@Test

public void testDeleteSameGroup () {
		
	// save old state
	SortedListOf<GroupDate> oldList = app.getGroupHelper().getGroups();
	
	Random rnd = new Random();
	int index = rnd.nextInt(oldList.size()-1);
				
	// actions
	app.getGroupHelper().deleteGroup(index);
	    
	// save new state
	SortedListOf<GroupDate> newList = app.getGroupHelper().getGroups();
    
    // compare states
    assertThat(newList, equalTo(oldList.without(index)));		    
    
	
}

}
